import java.util.Scanner;
class UserInput {
	int value;

	void getInput(String prompt) {
		Scanner in = new Scanner(System.in);
		System.out.println(prompt);
		String stringNumber;
		do {
			stringNumber = in.nextLine().trim();
			if (stringNumber.matches("[1-9][0-9]*")) {
				break;
			}
			System.out.println("Incorrect input format. " + prompt);
		} while (true);
		in.close();
		value = Integer.parseInt(stringNumber);
	}

	void setInput(int toBeSet) {
		value = toBeSet;
	}
}